<!doctype html>
<html>
<head>
	<meta http-equiv="Content-Type" Content="text/html; charset=utf-8"/>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.21/angular.min.js"></script>
	<link rel="stylesheet" type="text/css" href="../css/header.css">
	<link rel="stylesheet" type="text/css" href="../css/footer.css">
	<link rel="stylesheet" type="text/css" href="../css/notice_board.css">
	<link rel="stylesheet" href="../res/bootstrap/css/bootstrap.min.css">
	<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.11.1.js"></script>
	<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.4/jquery-ui.js"></script>
	<script src="../myUtil.js"></script>
	<script type="text/javascript" src="../js/notice_board.js"></script>


</head>
<body ng-app="myModule">
<div class="container" ng-controller="MyController">
<!-- header-->
<div class="header span12">
</div>

<!--notice_content-->
<h1>공지사항</h1> 공지사항 내용 확인
<br/>
<div class="offset10" ng-click="list()"><button class="btn" >목록으로</button></div>
<div class="notice_board">

                                                                #?pg='+$location.search().pg+"&title="+$location.search().title+"&subject="+$location.search().subject+"&search="+$location.search().search;
	<span class="notice_define">{{subject.name}}</span><span>{{items.title}}</span><span class="right"><span class="date">{{items.dateShort}}</span>
	<span class="adim_see" >	<a href="notice_board_edit.html#?content_id={{items.content_id}}" ng-if="id==items.id">수정</a>&nbsp;&nbsp;<a ng-if="id==items.id || user.authority=='ROLE_ADMIN'">삭제</a></span></span>
	<!--class="adim_see"의 경우에는 추후 관리자만 show 나머지 hide-->
</div>
<div class="notice_board">
	<span class="notice_define">작성자 : </span><span>{{items.id}}</span>
	<span class="notice_define">조회수 : </span><span >{{items.hit}}</span>

	<span class="right"><a onclick="add()">첨부파일<i class="icon-circle-arrow-down"></i></a></span>
	<br/>
	<!--DB에서 첨부파일 링크를 가져옴-->
	<div class="add span3">
	<a ng-repeat="file in files" ng-click="download(file.file_id)">●{{file.file_name}}<br/></a>
	</div>

	<div class="notice-content">
	{{items.content}}
	<!--공지사항 내용을 DB에 꺼내서 넣을 곳-->
	</div>
	<br/>
	
	<span class="notice_define">{{items.reply_count}}</span>
	<!--추가된 댓글 양식 : Angular js의 경우 여기에 for loop를 걸면 됨-->
	
	<div class="user comment " ng-repeat="item in reply">
	
		<span class="name">{{item.name}}</span><span class="id">({{item.id}})</span><span class="date">{{item.shortdate}}</span>
		<span class="user_see right" ng-if="item.id==id && selectedIndex!=$index" ><a ng-click="modify($index,item.content);">수정</a>&nbsp;&nbsp;
		<a ng-click="replyDelete($index)" ng-if="item.id==id && selectedIndex!=$index" >삭제</a></span>
		
		<span class="user_see right" ng-if="item.id==id && selectedIndex==$index" ><a ng-click="init()">수정취소</a>&nbsp;&nbsp;
		<a ng-click="init(); replyModify(item.reply_id);" ng-if="item.id==id && selectedIndex==$index">수정완료</a></span>
		
		
		<!--class="user_see"의 경우에는 추후 해당 id만 show 나머지 hide-->
		
		<div class="com_content" ng-if="selectedIndex!=$index" >{{item.content}}</div>
		<div ><textarea style="width: 50em;" class="com_content" ng-model="modifyReply.content" ng-if="selectedIndex==$index" ></textarea></div>
		
		<hr/>
		
	</div>
	
	<!--//추가된 댓글 양식-->

	<div class="comment" ng-if="id!=''">
		<i class="icon-bullhorn"></i><textarea class="comm" ng-model="writeReply.content" ></textarea>
		<button ng-click="replyWrite()" type="button" class="btn btn-primary">댓글 등록</button>
	</div>
	
</div>
<!--//notice_content-->

<!--footer-->
	<div class="footer span12"></div>
<!--//footer-->
</div>
</body>
</html>